import request from '@/utils/request'

export function getCustomers(params) {
  return request({
    url: '/clients',
    method: 'get',
    params
  })
}

export function getAgents() {
  return request({
    url: '/agents'
  })
}

export function addClients(data) {
  return request({
    url: '/clients',
    method: 'post',
    data
  })
}

export function getCustomerById(id) {
  return request({
    url: `/clients/${id}`
  })
}

export function editClients(data) {
  return request({
    url: `/clients/${data.id}`,
    method: 'put',
    data
  })
}

export function delClients(id) {
  return request({
    url: `/clients/${id}`,
    method: 'delete'
  })
}

export function getCount(params) {
  return request({
    url: '/clients/count',
    method: 'get',
    params
  })
}
